package com.zzh.controller;


import com.zzh.entity.User;
import com.zzh.service.UserService;
import com.zzh.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/user")
public class UserController {

    @Autowired
    private UserService userService;

    /**
     * 查询所有用户信息（测试时使用）
     * @return
     */
    @GetMapping("listAll")
    public Result listAll(){
        List<User> list = userService.list();
        System.out.println(list);
        return Result.ok(list);
    }
}

